/**
 * Created by Toma on 2016/11/29.
 * node 事件模块
 *    1. 默认最多同时监听10个相同的指令
 *    2. 增加指令数：life.setMaxListeners(11);
 *    3. 移除一项 life.removelistener('e', 必须是函数名)
 *    4. 移除多项 life.removeAlllisteners()
 *    5. 事件数量 life.listeners('e').length;
 */

var EventEmitter = require('events').EventEmitter;
var life = new EventEmitter();

life.on('求安慰', function (who) {
  console.log(who + ' 给倒水');
});

life.emit('求安慰','汉子');
life.emit('求安慰','妹子');

